<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<?php
    require_once "../funciones.php";
    $con = con_caweb();
    $id = $_GET['id'];
    ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <script src="../js/jquery.js" type="text/javascript"></script>
        <script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>
    </head>
    <script type="text/javascript">
            function enviar(){
                if($("#observacion").val() == "" || $("#observacion").val().length < 2)
                    alert("Ingrese una justificacion");
                else{
                    $.post("../scripts/scconEquSinFactDet.php?opc=upt", $("#internos").serialize(), function(infor){
                        var tmp ="";
                        if($.browser.msie)
                            tmp = "\nRecomendamos recargar la grilla en la parte inferior de la misma";
                        alert(infor + tmp);
                        $("#cancelar").trigger('click');
                    });

                }
                window.opener.nofactura(2,0);
                //window.close()
            }

    </script>
    <body>
        <form  method="POST" name="internos" id="internos">
        <table border="1">
            <caption><h4>DEJARA DE FACTURAR LOS ITEMS RELACIONADOS</h4></caption>
            <tr>
                <td><label for="est">Descripcion</label></td>
                <td>
                    <input type="text" name="observacion" id="observacion" />
                </td>
            </tr>
            <tr>
                <td><label for="equipos">Items</label></td>
                <td>
                    <select>
                        <?php
                            $ids = split(",",$id);
                            foreach ($ids as $value) {
                                //Se pone en contexto la informacion de la inconcistencia
                                $sql = "select interno,item from basefacturacion where id = $value";
                                $result = mysql_query($sql) or die("Error SQL1".  mysql_error());
                                $basef = mysql_fetch_array($result);
                                echo "<option value=''>".$basef['interno']."->".$basef['item']."</option>";
                            }
                        ?>
                    </select>
                    <input type="hidden" name="ids" value="<?php echo $id; ?>" />
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="button" value="Actualizar" style="font-size: 14; font-style: italic; " onclick="return enviar();" />
                    <input type="button" value="Cerrar" style="font-size: 14; " id="cancelar" onclick="window.close()" />
                </td>
            </tr>
        </table>
            </form>
    </body>
</html>
